POV-Ray : Newsgroups : povray.general : macro parameters : Re: macro parameters Server Time
1 Aug 2024 06:21:31 EDT (-0400)
  Re: macro parameters  
From: Chris B
Date: 12 Feb 2006 08:24:22
Message: <43ef3706$1@news.povray.org>
"kurtz le pirate" <kur### [at] yahoofr> wrote in message
news:kurtzlepirate-D923AB.09321512022006@news.povray.org...
> hi,
>
> i am trying to make a macro with one of parameters is "normal" like this
> #macro foo(.., .., thisNormal, ..)
>  ...
>  normal { thisNormal }
>  ...
> #end
>
> ok, works fine... but in some cases i don't want normal.
> how can i pass a "no-normal" or "empty-normal" parameters ?
>
> any ideas ?
>
> thanks.

Hi Kurtz,

I don't know how to do exactly what you ask. Just in case no-one else does 
either, here's a work-around.
Forgive me if it's just dodging the question, or if it's describing 
something that's already obvious to you.

Regards,
Chris B.

camera {location <0,0,-4> look_at <0,0,0>}
light_source{<0,3,-10> rgb 1}
#macro foo ()
  cylinder {-1,1,0.5
    texture {
      pigment {color rgb <1,1,1>}
      #ifdef (thisNormal) normal {thisNormal} #end
    }
  }
#end

#declare thisNormal = normal {agate};
foo()
#undef thisNormal
object {foo() rotate -y*90}
#declare thisNormal = normal {marble 2 turbulence 0.5};
object {foo() rotate y*135}


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.